logistic regression classifier from scratch